package com.zmn.oms.model.vo.work.erp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Objects;
import java.util.Optional;

/**
 * @author sunlife
 * @date:2020/10/15 5:21 下午
 * description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SubsidySharingVO {

    /**
     * 远程补贴
     */
    private Integer distanceSubsidy;

    /**
     * 加急补贴
     */
    private Integer urgentSubsidy;

    /**
     * 区域补贴
     */
    private BigDecimal areaSubsidy;

    /**
     * 区域补贴金额
     */
    private Integer areaSubsidyAmount;

    public Integer getTotalAmount() {
        return Optional.ofNullable(distanceSubsidy).orElse(0) + Optional.ofNullable(urgentSubsidy).orElse(0) + Optional.ofNullable(areaSubsidyAmount).orElse(0);
    }
}
